package diqizhou;

import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main1 {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		Set<String> set = new TreeSet<String>();
		while(sc.hasNext())
		{
			String str=sc.next();
			if(str.equals("!!!!!"))
				break;
			set.add(str);
		}
		System.out.println(set.size());
		if (set.size() <= 10){
			for (String string : set) {
				System.out.println(string);
			}
		}else{
			for (int i = 0; i < 10; i++) {
				System.out.println(set.toArray()[i]);
			}
		}
		sc.close();

	}

}
